<form class="validforms" method="post" id="login_form" name="login_form">
    <div class="flow-consignee ect-bg-colorf">
        <section>
            <ul>
                <li>
                    <?php
                    $userPlaceholder = $this->translate('会员名称');
                    if($this->email_login_state == 'true') $userPlaceholder .= '/'.$this->translate('电子邮箱');
                    if($this->phone_login_state == 'true') $userPlaceholder .= '/'.$this->translate('手机号码');
                    ?>
                    <div class="input-text"><b><?php echo $this->translate('登录名'); ?><font class="must_add_value">*</font>：</b><span><input type="text" id="user_name" datatype="*" class="inputBg" name="user_name" placeholder="<?php echo $userPlaceholder; ?>" nullmsg="<?php echo $this->translate('输入登录名'); ?>"></span></div>
                </li>
                <li>
                    <div class="input-text"><b><?php echo $this->translate('密码'); ?><font class="must_add_value">*</font>：</b><span><input type="password" class="inputBg" datatype="*" id="user_password" name="user_password" placeholder="<?php echo $this->translate('密码'); ?>" nullmsg="<?php echo $this->translate('输入会员密码'); ?>"></span></div>
                </li>
                <?php if ($this->frontwebsite()->websiteCaptchaState('user_login_captcha') == 'true') { ?>
                <li>
                    <div class="input-text code"><b><?php echo $this->translate('验证码'); ?><font class="must_add_value">*</font>：</b>
                        <span>
                            <input type="text" datatype="*" name="captcha_code" ajaxurl="<?php echo $this->url('mobile/default',array('action'=>'checkCaptcha')); ?>" placeholder="<?php echo $this->translate('输入验证码'); ?>" nullmsg="<?php echo $this->translate('输入验证码'); ?>">
                        </span>
                        <img style="width: auto;" id="login_captcha_id" src="" onclick="captchaAdd();" class="pull-right">
                    </div>
                </li>
                <?php } ?>
            </ul>
        </section>
    </div>
    <input type="hidden" name="<?php echo $this->login_csrf['name']; ?>" value="<?php echo $this->login_csrf['value']; ?>" />
    <input type="hidden" name="http_referer" value="<?php echo $this->http_referer; ?>" />
<div class="ect-padding-lr ect-padding-tb"> <input type="submit" value="<?php echo $this->translate('立即登陆'); ?>" class="btn btn-info ect-btn-info ect-colorf"></div>
</form>

<p style="clear:both" class="ect-padding-lr ect-margin-tb text-right ect-margin-bottom0">
    <a href="<?php echo $this->url('m_user/default',array('action'=>'forgotpasswd')); ?>"><?php echo $this->translate('忘记密码'); ?></a>
    <a href="<?php echo $this->url('m_user/default',array('action'=>'register')); ?>"><?php echo $this->translate('免费注册'); ?></a>
</p>

<?php if($this->frontwebsite()->getUserOtherLoginState() == 'true') { ?>
<div class="ect-padding-lr ect-margin-tb user-hezuo">
    <?php echo $this->translate('使用合作账号登录'); ?>
    <?php
    $otherLoginArray = $this->frontwebsite()->getUserOtherLoginIni();
    if(!empty($otherLoginArray)) {
        foreach($otherLoginArray as $othKey => $othValue) {
            if($othValue['login_state'] == 'true') {
                $othKey = strtolower($othKey);
                if($othKey == 'weixinphone') {
                    if(strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
                        ?>
                        <p><a href="<?php echo $this->url('m_user/default',array('action'=>'otherlogin'), array('query'=>array('login_type'=>$othKey))); ?>"><img src="<?php echo $this->basePath('public/mobile/default/images/'.$othKey.'.png'); ?>"></a></p>
                        <?php
                    }
                } else {
                    if(strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false && $othKey == 'alipay') continue;
                    ?>
                    <p><a href="<?php echo $this->url('m_user/default',array('action'=>'otherlogin'), array('query'=>array('login_type'=>$othKey))); ?>"><img src="<?php echo $this->basePath('public/mobile/default/images/'.$othKey.'.png'); ?>"></a></p>
                    <?php
                }
            }
        }
    }
    ?>
</div>
<?php } ?>

<script>
<?php if (isset($this->message) and $this->message != '') echo "alert('".$this->message."');"; ?>

    <?php if ($this->frontwebsite()->websiteCaptchaState('user_login_captcha') == 'true') { ?>
    //验证码添加
    function captchaAdd() {
        $.get("<?php echo $this->url('shopfront/default',array('action'=>'captcha')); ?>",{},
            function(data){
                $("#login_captcha_id").attr('src', '<?php echo $this->basePath('/'); ?>'+data.captcha_file);
            },'json');
    }
    captchaAdd();
    <?php } ?>
</script>